<%--
  User: 19079,Date: 2020/11/27,time: 14:47
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>Title</title>
    <base href="<%=request.getContextPath()%>">
    <link rel="stylesheet" href="webjars/layui/2.5.5/css/layui.css">
</head>
<body>
<br/>
<br/>
<div class="layui-container" style="width: 70%">
    <div class="layui-colla-item">
        <form class="layui-form" action="/index" method="get">
            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-inline">
                <div class="layui-input-inline">
                    <input type="submit" value="搜索" class="layui-btn">
                </div>
            </div>
        </form>
    </div>


    <table id="userTb" lay-filter="userTb"></table>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
        <a class="layui-btn layui-btn-xs" lay-event="update">修改</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
<%--            <tr>--%>
<%--                <th>id</th>--%>
<%--                <th>姓名</th>--%>
<%--                <th>薪资</th>--%>
<%--                <th>出生日期</th>--%>
<%--                <th>进入公司日期</th>--%>
<%--                <th>操作</th>--%>
<%--            </tr>--%>
</div>

<script src="webjars/layui/2.5.5/layui.js"></script>
<script>
    layui.use(["table","element"],function () {
        layui.table.render({
            elem:"#userTb",
            url:"/getAll",
            even:true,
            toolbar:"#toolbar",
            cols:[[
                {field:"id",title:"编号"},
                {field:"name",title:"姓名"},
                {field:"money",title:"薪资"},
                {field:"birthday",title:"出生日期"},
                {field:"newDate",title:"入职日期"},
                {toolbar:"#barDemo",title:"操作"}
            ]]
        })
    });
</script>
</body>
</html>
